<include file="Public:header" />
<script>
current_group="{$vo.slug}";
groupid="{$vo.id}";

function do_add(id)
{
	requesthtml("{:U('ajax_add')}","parentid="+id+"&category_slug="+current_group+"&groupid="+groupid,true);
}
function do_edit(id)
{
	requesthtml("{:U('ajax_edit')}","id="+id,true);
}
function do_del(id)
{
	confim_del('{$Think.lang.L_ARE_YOU_SURE}','../../ajax_del/id/'+id+'.html');
}

</script>

<form action="{:U('item_update')}" method="post" name="fomr1" class="form-horizontal" >
  <table align="center" class="table table-bordered table-striped">
    <tr id="cat_0">
      <th>{$Think.lang.L_NAME}</th>
      <th>{$Think.lang.L_SLUG}</th>
      <th width="90">{$Think.lang.L_OP}</th>
    </tr>
    {:tree_recursive($cat,'
    <tr align="center" id="cat_%%id%%">
      <td><input type="hidden" name="iid[]" value="%%id%%"/>
         %%level_intend%%
        %%name%%</td>
      <td>%%slug%%</td>
      <td><a href="javascript:do_add(%%id%%,%%level_deep%%);" ><i class="icon-plus"></i></a> <a href="javascript:do_edit(%%id%%);" ><i class="icon-edit"></i></a> <a href="javascript:do_del(%%id%%);" ><i class="icon-remove"></i></a></td>
    </tr>
    ','item',array("%%name%%","%%slug%%","%%id%%","%%parent%%"),array("name","slug","id","parent"))}
    <tr><td colspan="3"><a href="javascript:do_add(0,0);" ><i class="icon-plus"></i></a></td></tr>
  </table>
 
</form>
<include file="Public:footer" /> 